<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="Environment,mathlib.expr.Environment,fns,consts,addops,mulops,vars,varCount,doImplicitMult,addVar,addVars,addFn,addConst,addAddOp,addMulOp,isKnownId,isValidId" name="keywords">
<title>mathlib.expr.Environment</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Environment - API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">flashgraph API Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mathlib/expr/Environment.html&amp;mathlib/expr/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Environment</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Environment"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mathlib.expr</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Environment</td>
</tr>
</table>
<p></p>
 Encapsulates the known functions, constants, operators and variables in a
 particular parse.
 <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#addops">addops</a> : Dictionary<div class="summaryTableDescription">
  Map of strings to binary Functions.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#consts">consts</a> : Dictionary<div class="summaryTableDescription">
  Map of constant names to their Number values.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#doImplicitMult">doImplicitMult</a> : Boolean = true<div class="summaryTableDescription"> Set to true to allow implicit multiplication (e.g., 5x -> 5*x).</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#fns">fns</a> : Dictionary<div class="summaryTableDescription">
  Map of function names to Function objects.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#mulops">mulops</a> : Dictionary<div class="summaryTableDescription">
  Map of strings to binary Functions.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#varCount">varCount</a> : int<div class="summaryTableDescription"> The number of IndVars in the <code>vars</code> Dictionary.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#vars">vars</a> : Dictionary<div class="summaryTableDescription">
  Map of strings and integers to IndVars.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Environment()">Environment</a>(... args)</div>
<div class="summaryTableDescription">
  Creates a new instance of an Environment.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addAddOp()">addAddOp</a>(opName:String, fn:Function):void</div>
<div class="summaryTableDescription">
  Add an operator with the same precedence as addition to the given
  instance.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addConst()">addConst</a>(constName:String, constVal:Number):void</div>
<div class="summaryTableDescription">
  Add a constant to the given instance.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addFn()">addFn</a>(fnName:String, fn:Function):void</div>
<div class="summaryTableDescription">
  Add a function to the given instance.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addMulOp()">addMulOp</a>(opName:String, fn:Function):void</div>
<div class="summaryTableDescription">
  Add an operator with the same precedence as multiplication to the
  given instance.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addVar()">addVar</a>(varName:String):void</div>
<div class="summaryTableDescription">
  Add a variable to the given instance.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addVars()">addVars</a>(varNames:Array):void</div>
<div class="summaryTableDescription">
  Add a number of variables to the given instance.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#isKnownId()">isKnownId</a>(id:String):Boolean</div>
<div class="summaryTableDescription">
  Returns true if the given string corresponds to a known identifier
  in this Environment.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#isValidId()">isValidId</a>(id:*):Boolean</div>
<div class="summaryTableDescription">
  Returns true if the given string is a valid name for an identifier in
  this Environment.</div>
</td><td class="summaryTableOwnerCol">Environment</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="addops"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addops</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var addops:Dictionary</code><p>
  Map of strings to binary Functions. These are operators having the
  same precedence as addition (+, -). Members can be added with the
  <code>addAddOp</code> method.
  </p><p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addAddOp()" target="">addAddOp()</a>
</div>
</div>
<a name="consts"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">consts</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var consts:Dictionary</code><p>
  Map of constant names to their Number values. Members can be added
  with the <code>addConst</code> method.
  </p><p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addConst()" target="">addConst()</a>
</div>
</div>
<a name="doImplicitMult"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">doImplicitMult</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var doImplicitMult:Boolean = true</code><p> Set to true to allow implicit multiplication (e.g., 5x -> 5*x). </p></div>
<a name="fns"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">fns</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var fns:Dictionary</code><p>
  Map of function names to Function objects. Members can be added with
  with the <code>addFn</code> method.
  </p><p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addFn()" target="">addFn()</a>
</div>
</div>
<a name="mulops"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">mulops</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var mulops:Dictionary</code><p>
  Map of strings to binary Functions. These are operators having the
  same precedence as multiplication (*, /). Members can be added with
  the <code>addMulOp</code> method.
  </p><p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addMulOp()" target="">addMulOp()</a>
</div>
</div>
<a name="varCount"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">varCount</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var varCount:int</code><p> The number of IndVars in the <code>vars</code> Dictionary. </p></div>
<a name="vars"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">vars</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var vars:Dictionary</code><p>
  Map of strings and integers to IndVars. The contents are indexed
  by both variable name and their integral index. Members can be added
  in the constructor or with the <code>addVar</code> and
  <code>addVars</code> methods.
  </p><p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addVars()" target="">addVars()</a>
</div>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Environment()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Environment</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Environment(... args)</code><p>
  Creates a new instance of an Environment. This establishes a large
  number of default functions, constants and operators.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">args</span></code> &mdash; The constructor may be given no arguments, an array of
   Strings, or a list of Strings. In the first case, no independent
   variable names are set up. In the latter cases, the given strings 
   are passed along to the <code>addVars</code> method. See the
   documentation for <code>isValidId</code> for details on valid
   variable names.
    <p>The following functions are present in a default Environment:
   <table class="innertable"><th>Function</th><th>Corresponding ActionScript</th><th>Meaning</th>
   <tr><td><code>sin(x)</code></td><td><code>Math.sin(x)</code></td><td>The sine of <code>x</code> where <code>x</code> is in radians</td></tr>
   <tr><td><code>cos(x)</code></td><td><code>Math.cos(x)</code></td><td>The cosine of <code>x</code> where <code>x</code> is in radians</td></tr>
   <tr><td><code>tan(x)</code></td><td><code>Math.tan(x)</code></td><td>The tangent of <code>x</code> where <code>x</code> is in radians</td></tr>
   <tr><td><code>asin(x)</code>, <code>arcsin(x)</code></td><td><code>Math.asin(x)</code></td><td>The arcsine of <code>x</code> in radians</td></tr>
   <tr><td><code>acos(x)</code>, <code>arccos(x)</code></td><td><code>Math.acos(x)</code></td><td>The arccosine of <code>x</code> in radians</td></tr>
   <tr><td><code>atan(x)</code>, <code>arctan(x)</code></td><td><code>Math.atan(x)</code></td><td>The arctangent of <code>x</code> in radians</td></tr>
   <tr><td><code>atan2(x, y)</code>, <code>arctan2(x, y)</code></td><td><code>Math.atan2(x, y)</code></td><td>The arctangent of <code>y / x</code> in radians</td></tr>
   <tr><td><code>exp(x)</code></td><td><code>Math.exp(x)</code></td><td><code>e^x</code> where <code>e</code> is Euler's constant</td></tr>
   <tr><td><code>sqrt(x)</code></td><td><code>Math.sqrt(x)</code></td><td>The square root of <code>x</code></td></tr>
   <tr><td><code>pow(x, p)</code></td><td><code>Math.pow(x, p)</code></td><td><code>x^p</code></td></tr>
   <tr><td><code>log(x)</code>, <code>ln(x)</code></td><td><code>Math.log(x)</code></td><td>The natural logarithm of <code>x</code></td></tr>
   <tr><td><code>log10(x)</code></td><td><code>Math.log(x) / Math.LN10</code></td><td>The base-10 logarithm of <code>x</code></td></tr>
   <tr><td><code>log2(x)</code></td><td><code>Math.log(x) / Math.LN2</code></td><td>The base-2 logarithm of <code>x</code></td></tr>
   <tr><td><code>max(x, y)</code></td><td><code>Math.max(x, y)</code></td><td>The maximum of <code>x</code> and <code>y</code></td></tr>
   <tr><td><code>min(x, y)</code></td><td><code>Math.min(x, y)</code></td><td>The minimum of <code>x</code> and <code>y</code></td></tr>
   <tr><td><code>abs(x)</code></td><td><code>Math.abs(x)</code></td><td>The absolute value of <code>x</code></td></tr>
   <tr><td><code>floor(x)</code></td><td><code>Math.floor(x)</code></td><td>The closest integer less than or equal to <code>x</code></td></tr>
   <tr><td><code>ceil(x)</code></td><td><code>Math.ceil(x)</code></td><td>The closest integer greater than or equal to <code>x</code></td></tr>
   <tr><td><code>round(x)</code></td><td><code>Math.round(x)</code></td><td>The closest integer to <code>x</code>. If <code>x</code> ends in .5, it is rounded up.</td></tr>
   <tr><td><code>random()</code>, <code>rnd()</code>, <code>rand()</code></td><td><code>Math.random()</code></td><td>A pseudo-random number between 0 and 1</td></tr>
   <tr><td><code>mod(x, m)</code></td><td><code>x % m</code></td><td>The remainder when <code>x</code> is divided by <code>m</code></td></tr>
   </table></p>
  <p>The following constants are present in a default Environment:
   <table class="innertable"><th>Constant Name</th><th>Corresponding ActionScript</th><th>Meaning</th>
   <tr><td><code>e</code></td><td><code>Math.E</code></td><td>Euler's constant, the base of natural logarithms</tr>
   <tr><td><code>ln10</code>, <code>log10</code></td><td><code>Math.LN10</code></td><td>The natural logarithm of 10</td></tr>
   <tr><td><code>ln2</code>, <code>log2</code></td><td><code>Math.LN2</code></td><td>The natural logarithm of 2</td></tr>
   <tr><td><code>log10e</code></td><td><code>Math.LOG10E</code></td><td>The base-10 logarithm of e</td></tr>
   <tr><td><code>log2e</code></td><td><code>Math.LOG2E</code></td><td>The base-2 logarithm of e</td></tr>
   <tr><td><code>pi</code></td><td><code>Math.PI</code></td><td>The ratio of a circle's circumference to its diameter</td></tr>
   <tr><td><code>sqrt1_2</code></td><td><code>Math.SQRT1_2</code></td><td>The square root of one-half</td></tr>
   <tr><td><code>sqrt2</code></td><td><code>Math.SQRT2</code></td><td>The square root of 2</td></tr>
   </table></p>
  <p>The following operators are present in a default Environment, with
   the same meaning as in ActionScript: <code>+, -, *, /<code>.</p>
    </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: A variable name is
   invalid or conflicts with another identifier.
    </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addVars()" target="">addVars()</a>
<br>
<a href="../expr/Environment.html#isValidId()" target="">isValidId()</a>
</div>
<br>
<span class="label">Example</span>
<br>The following code results in three equivalent Environments.
   <div class='listing'><pre>
    var env1:Environment = new Environment()
    env1.addVars(["x", "y"]);
    var env2:Environment = new Environment(["x", "y"]);
    var env3:Environment = new Environment("x", "y");</pre></div>
    <p></p>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addAddOp()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addAddOp</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addAddOp(opName:String, fn:Function):void</code><p>
  Add an operator with the same precedence as addition to the given
  instance.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">opName</span>:String</code> &mdash; The name of the operator. Little sanity checking is done
   on this argument, but it must be a one-character symbol and not a
   known identifier (i.e., <code>isKnownId</code> must return false).
   If either of these is not the case, an <code>ArgumentError</code>
   will be thrown.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">fn</span>:Function</code> &mdash; The ActionScript function corresponding to the operator 
   name. If it is not binary (i.e., if it does not take exactly 2 
   arguments), an <code>ArgumentError</code> will be thrown. Its arity 
   will be determined from its <code>length</code> property, so
   functions that use the <code>...</code> notation for accepting a
   variable number of arguments may not work as intended.
   </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: The operator name
   conflicts with another identifier or <code>fn</code> is not binary.
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#isKnownId()" target="">isKnownId()</a>
</div>
</div>
<a name="addConst()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addConst</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addConst(constName:String, constVal:Number):void</code><p>
  Add a constant to the given instance.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">constName</span>:String</code> &mdash; The new constant name to add. If this is already a
   known identifier (i.e., if <code>isKnownId(constName)</code> is true)
   or if it is an invalid identifier (i.e., 
   <code>isValidId(constName)</code> is false), an 
   <code>ArgumentError</code> will be thrown.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">constVal</span>:Number</code> &mdash; The value of the constant.
   </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: The constant name is
   invalid or conflicts with another identifier.
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#isKnownId()" target="">isKnownId()</a>
<br>
<a href="../expr/Environment.html#isValidId()" target="">isValidId()</a>
</div>
</div>
<a name="addFn()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addFn</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addFn(fnName:String, fn:Function):void</code><p>
  Add a function to the given instance.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">fnName</span>:String</code> &mdash; The name of the function. If this is already a known
   identifier (i.e., if <code>isKnownId(fnName)</code> is true) or if
   it is an invalid identifier (i.e., <code>isValidId(fnName)</code> is
   false), an <code>ArgumentError</code> will be thrown.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">fn</span>:Function</code> &mdash; The ActionScript function corresponding to the function 
   name. Its arity will be determined from its <code>length</code>
   property, so functions that use the <code>...</code> notation for
   accepting a variable number of arguments may not work as intended.
   </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: The function name is
   invalid or conflicts with another identifier.
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#isKnownId()" target="">isKnownId()</a>
<br>
<a href="../expr/Environment.html#isValidId()" target="">isValidId()</a>
</div>
</div>
<a name="addMulOp()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addMulOp</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addMulOp(opName:String, fn:Function):void</code><p>
  Add an operator with the same precedence as multiplication to the
  given instance.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">opName</span>:String</code> &mdash; The name of the operator. Little sanity checking is done
   on this argument, but it must be a one-character symbol and not a
   known identifier (i.e., <code>isKnownId</code> must return false).
   If either of these is not the case, an <code>ArgumentError</code>
   will be thrown.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">fn</span>:Function</code> &mdash; The ActionScript function corresponding to the operator 
   name. If it is not binary (i.e., if it does not take exactly 2 
   arguments), an <code>ArgumentError</code> will be thrown. Its arity 
   will be determined from its <code>length</code> property, so
   functions that use the <code>...</code> notation for accepting a
   variable number of arguments may not work as intended.
   </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: The operator name
   conflicts with another identifier or <code>fn</code> is not binary.
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#isKnownId()" target="">isKnownId()</a>
</div>
</div>
<a name="addVar()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addVar</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addVar(varName:String):void</code><p>
  Add a variable to the given instance.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">varName</span>:String</code> &mdash; The new variable name to add. If this is already a
   known identifier (i.e., if <code>isKnownId(varName)</code> is true)
   or if it is an invalid identifier (i.e.,
   <code>isValidId(varName)</code> is false), an 
  <code>ArgumentError</code> will be thrown.
  </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: The variable name is
   invalid or conflicts with another identifier.
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#isKnownId()" target="">isKnownId()</a>
<br>
<a href="../expr/Environment.html#isValidId()" target="">isValidId()</a>
</div>
</div>
<a name="addVars()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addVars</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addVars(varNames:Array):void</code><p>
  Add a number of variables to the given instance.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">varNames</span>:Array</code> &mdash; An array of Strings corresponding to variable names
   to add. They must meet the same requirements as an argument to
   <code>addVar</code>.
   </td>
</tr>
</table>
<br>
<span class="label">Throws</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code></code> &mdash; <code>ArgumentError</code>: A variable name is
   invalid or conflicts with another identifier.
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../expr/Environment.html#addVar()" target="">addVar()</a>
</div>
</div>
<a name="isKnownId()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isKnownId</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function isKnownId(id:String):Boolean</code><p>
  Returns true if the given string corresponds to a known identifier
  in this Environment.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">id</span>:String</code> &mdash; The identifier to test.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code></td>
</tr>
</table>
</div>
<a name="isValidId()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isValidId</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function isValidId(id:*):Boolean</code><p>
  Returns true if the given string is a valid name for an identifier in
  this Environment. Note that this does not check for naming conflicts;
  use <code>isKnownId</code> for that purpose.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">id</span>:*</code> &mdash; The identifier to test. A valid identifier begins with a 
  letter or an underscore and then contains some number of letters,
  numbers, or underscores.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
